/**
 * 处理办理人id和名称
 * @param idKeys
 * @param nameKeys
 */
const splitDealId = (idKeys: string, nameKeys: string) => {
  let nodeDealList: Record<string, any>[] = [];

  // 处理人IDS
  const dealIds: string[] = idKeys?.split(',')?.filter((item: any) => item);

  //处理人名称
  const dealNames: string[] = nameKeys?.split(',')?.filter((item: any) => item);

  dealIds?.forEach((itemId: any, index: number) => {
    const dealName: string = dealNames?.[index];
    let posUserInfo: Record<string, any> = {};
    if (itemId) {
      const [itemPostId, itemUserId] = itemId?.split('|');
      posUserInfo['dealPostId'] = itemPostId;
      posUserInfo['dealUserId'] = itemUserId;
    }
    if (dealName) {
      const [itemPostName, itemUserName] = dealName?.split('|');
      posUserInfo['dealPostName'] = itemPostName;
      posUserInfo['dealUserName'] = itemUserName;
    }
    nodeDealList?.push(posUserInfo);
  });
  return nodeDealList;
};

export { splitDealId };
